emacs.git
21 months ago; Tweak recent NEWS and window.el docs.
Basil L. Contovounesios [Mon, 10 Jun 2024 05:29:38 +0000 (07:29 +0200)]
; Tweak recent NEWS and window.el docs.

21 months ago; * lisp/outline.el: Remove unused variable.
Juri Linkov [Mon, 10 Jun 2024 06:39:41 +0000 (09:39 +0300)]
; * lisp/outline.el: Remove unused variable.

21 months ago* lisp/outline.el: Improve new feature of preserving outlines after revert.
Juri Linkov [Mon, 10 Jun 2024 06:34:15 +0000 (09:34 +0300)]
* lisp/outline.el: Improve new feature of preserving outlines after revert.

(outline-minor-mode): Move adding hook 'outline-revert-buffer-rehighlight'
to the same code branch that calls 'outline-minor-mode-highlight-buffer'.
(outline-revert-buffer-rehighlight): Remove same conditions
already existing in 'outline-minor-mode'.
(outline-hidden-headings-regexp): Remove function.
(outline-hidden-headings-paths)
(outline-hidden-headings-restore-paths): New functions
that save and restore complete paths instead of flat regexps.
(outline-revert-buffer-restore-visibility): Use
'outline-hidden-headings-paths' and
'outline-hidden-headings-restore-paths'.

21 months agoRe-enable TTY glyph production for batch mode frames on Android
Po Lu [Mon, 10 Jun 2024 03:56:24 +0000 (11:56 +0800)]
Re-enable TTY glyph production for batch mode frames on Android

* lisp/org/ob-core.el (org-babel-execute-src-block): Revert
previous change.

* src/term.c (tty_append_glyph, produce_glyphs) [HAVE_ANDROID]:
Re-enable suppressed code.

21 months agoFix bootstrap of org.texi
Po Lu [Mon, 10 Jun 2024 00:37:51 +0000 (08:37 +0800)]
Fix bootstrap of org.texi

* lisp/org/ob-core.el (org-babel-execute-src-block): Ignore
errors around code block execution.

21 months ago; Fix typos
Stefan Kangas [Sun, 9 Jun 2024 22:38:13 +0000 (00:38 +0200)]
; Fix typos

21 months agoImprove correctness of 'eshell-quote-argument'
Jim Porter [Sun, 9 Jun 2024 22:21:08 +0000 (15:21 -0700)]
Improve correctness of 'eshell-quote-argument'

* lisp/eshell/esh-arg.el (eshell-quote-argument): Mention that this
function is for use within Eshell buffers.
(eshell-quote-backslash): Properly quote newlines.

* lisp/eshell/em-unix.el (eshell/cat, eshell/du): Throw
'eshell-external' instead; that's what it's here for.

* test/lisp/eshell/esh-proc-tests.el (esh-proc-test-quote-argument):
Remove.
(esh-proc-test/emacs-command):
* test/lisp/eshell/esh-var-tests.el (esh-var-test/path-var/set)
(esh-var-test/path-var/set-locally): Use 'eshell-quote-argument'.

* test/lisp/eshell/em-unix-tests.el (em-unix-test/compile/interactive):
Use 'shell-quote-argument' (Note: *not* 'eshell-...').

21 months ago* etc/NEWS: Announce Org update.
Kyle Meyer [Sun, 9 Jun 2024 17:06:28 +0000 (13:06 -0400)]
* etc/NEWS: Announce Org update.

21 months agoUpdate to Org 9.7.3
Kyle Meyer [Sun, 9 Jun 2024 17:06:28 +0000 (13:06 -0400)]
Update to Org 9.7.3

21 months ago; Use the current system's style of shell-quoting in Eshell debug logs
Jim Porter [Sun, 9 Jun 2024 20:47:15 +0000 (13:47 -0700)]
; Use the current system's style of shell-quoting in Eshell debug logs

* lisp/eshell/esh-proc.el (eshell-gather-process-output): Don't force
POSIX syntax.  This is less confusing when running on MS-Windows.

21 months agoRemove empty Eshell commands when parsing
Jim Porter [Sun, 9 Jun 2024 20:17:53 +0000 (13:17 -0700)]
Remove empty Eshell commands when parsing

This improves the logic for copying/stealing handles when constructing
the command form: now, we should always steal the handles for the last
real command, even if there were some trailing semicolons.

* lisp/eshell/esh-arg.el (eshell-parse-delimiter): Be stricter about
parsing so that things like "& &" aren't parsed as a single "&&" token.

* lisp/eshell/esh-cmd.el (eshell-parse-command): Get the commands in
reverse, and remove any nil commands.
(eshell-split-commands): Always return the trailing terms (except when
there were no terms to begin with).

* test/lisp/eshell/esh-cmd-tests.el
(esh-cmd-test/empty-background-command): New test.

21 months ago; Allow batch-file Eshell test on MS-Windows
Eli Zaretskii [Sun, 9 Jun 2024 19:04:51 +0000 (22:04 +0300)]
; Allow batch-file Eshell test on MS-Windows

* test/lisp/eshell/em-script-tests.el (em-script-test/batch-file):
Don't skip on MS-Windows, as the test was fixed.

21 months agoUnbreak build with Clang 15 on macOS 14.5
Stefan Kangas [Sun, 9 Jun 2024 18:58:08 +0000 (20:58 +0200)]
Unbreak build with Clang 15 on macOS 14.5

* src/process.c (read_process_output): Use EQ for comparison.
(syms_of_process): Properly set a DEFVAR_BOOL to 'true' instead of 'Qt'.

21 months ago; Add another test for 'eshell-batch-script'
Jim Porter [Sun, 9 Jun 2024 18:53:29 +0000 (11:53 -0700)]
; Add another test for 'eshell-batch-script'

* lisp/eshell/em-script.el (eshell-close-target): New function.

* test/lisp/eshell/em-script-tests.el (em-script-test/batch-file): New
test; rename old one to...
(em-script-test/batch-file/shebang): ... this.

21 months ago* lisp/buff-menu.el: Support a function value of Buffer-menu-group-by.
Juri Linkov [Sun, 9 Jun 2024 18:18:28 +0000 (21:18 +0300)]
* lisp/buff-menu.el: Support a function value of Buffer-menu-group-by.

(Buffer-menu-group-by): Add a choice for a function that
returns names of all levels.
(list-buffers--refresh): If Buffer-menu-group-by is a function,
then use it directly.

21 months agoText improvements for the documentation of 'some-window' (bug#70949)
Juri Linkov [Sun, 9 Jun 2024 17:03:32 +0000 (20:03 +0300)]
Text improvements for the documentation of 'some-window' (bug#70949)

* doc/lispref/windows.texi (Buffer Display Action Functions):
Improve wording.  Suggested by martin rudalics <rudalics@gmx.at>.

21 months agoSpecify Python 3 in some ERTs on Mac
kobarity [Tue, 4 Jun 2024 12:51:32 +0000 (21:51 +0900)]
Specify Python 3 in some ERTs on Mac

* test/lisp/progmodes/python-tests.el
(python-tests-with-temp-buffer-with-shell): Remove setting
'python-shell-interpreter'.
(python-tests-shell-interpreter): Removed.
(python-tests-shell-interpreters): New variable.
(python-tests-with-shell-interpreter)
(python-tests-with-temp-buffer-with-shell-interpreter): New macros.
(python-tests-get-shell-interpreter): Add an optional PRED
argument to allow ERts to specify Python interpreter version.
(python-tests--get-interpreter-info): New function.
(python-tests-interpreter-3-p): New function to be used as the
PRED argument of 'python-tests-get-shell-interpreter'.
(python-shell-make-comint-1)
(python-shell-make-comint-2)
(python-shell-make-comint-4)
(python-shell-get-process-1)
(python-shell-internal-get-or-create-process-1)
(python-shell-prompt-detect-1)
(python-shell-prompt-detect-2)
(python-shell-prompt-detect-3)
(python-shell-prompt-detect-4)
(python-shell-prompt-detect-5)
(python-shell-prompt-detect-6)
(python-shell-prompt-set-calculated-regexps-6)
(python-shell-completion-at-point-jedi-completer)
(python-completion-at-point-pdb-1)
(python-completion-at-point-while-running-1)
(python-ffap-module-path-1)
(python-ffap-module-path-while-running-1)
(python-eldoc--get-doc-at-point-1)
(python-eldoc--get-doc-at-point-while-running-1)
(python-tests--run-python-selects-window)
(python-test--shell-send-block): Use the new macro.
(python-shell-completion-at-point-ipython): Remove setting
'python-tests-shell-interpreter'.
(python-shell-completion-at-point-1)
(python-completion-at-point-1)
(python-completion-at-point-2)
(python-completion-at-point-native-1)
(python-completion-at-point-native-2)
(python-completion-at-point-native-with-ffap-1)
(python-completion-at-point-native-with-eldoc-1): Use the new
macro and specify Python 3 on Mac to avoid errors.  (Bug#70815)

21 months agoFix hiding a Python block ending with a comment
kobarity [Sat, 25 May 2024 14:20:10 +0000 (23:20 +0900)]
Fix hiding a Python block ending with a comment

* lisp/progmodes/python.el (python-hideshow-forward-sexp-function): Move
point to the end of the line.
* test/lisp/progmodes/python-tests.el (python-hideshow-hide-block-2):
New test.  (Bug#71170)

21 months agoMerge branch 'master' of git.savannah.gnu.org:/srv/git/emacs
Eli Zaretskii [Sun, 9 Jun 2024 13:28:41 +0000 (16:28 +0300)]
Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs

21 months agoEnable accessing tool bar with the touch screen
Po Lu [Sun, 9 Jun 2024 13:25:08 +0000 (21:25 +0800)]
Enable accessing tool bar with the touch screen

* src/w32fns.c (w32_createwindow): Reset tool_bar_dwID.

* src/w32term.c (w32_read_socket): Reserve touch event sequences
that fall on the tool bar for future tool-bar manipulation.

* src/w32term.h (struct w32_output) <tool_bar_dwID>: New field.

21 months agoFix MS-Windows build broken by recent touch-screen changes
Eli Zaretskii [Sun, 9 Jun 2024 13:26:14 +0000 (16:26 +0300)]
Fix MS-Windows build broken by recent touch-screen changes

* src/w32term.c (TOUCHEVENTF_DOWN, TOUCHEVENTF_UP):
(struct _TOUCHINPUT): Move before first use.
(TOUCHEVENTF_MOVE, TOUCHEVENTMASKF_CONTACTAREA)
(TOUCHEVENTMASKF_EXTRAINFO, TOUCHEVENTMASKF_TIMEFROMSYSTEM): Ifdef
away unused macros.
(w32_read_socket): Fix typo.

21 months agoA better fix for esh-proc-tests on MS-Windows
Eli Zaretskii [Sun, 9 Jun 2024 13:12:11 +0000 (16:12 +0300)]
A better fix for esh-proc-tests on MS-Windows

* test/lisp/eshell/esh-proc-tests.el
(esh-proc-test-quote-argument): New function.
(esh-proc-test/emacs-command): Use it instead of
'shell-quote-argument', which allows to go back to
system-independent code.

21 months agoAmend last change
Po Lu [Sun, 9 Jun 2024 12:40:17 +0000 (20:40 +0800)]
Amend last change

* lisp/loadup.el: Load touch-screen.el on MS-Windows.

* src/w32fns.c (Emacs_GESTURECONFIG): New structure.
(SetGestureConfig_fn): New variable.
(w32_createwindow): Disable emulated mouse and gesture events
for the frame's window.
(w32_wnd_proc) <WM_LBUTTONDOWN, WM_RBUTTONDOWN, WM_LBUTTONUP>
<WM_RBUTTONUP>: Ignore mouse events which are marked as emulated
pointer events.
(globals_of_w32fns): Load SetGestureConfig from user32.dll.

* src/w32term.c (w32_read_socket): Correct utilization of
GetTouchInputInfo, coordinate spaces, &c.

21 months agoReport touch events on MS-Windows
Po Lu [Sun, 9 Jun 2024 09:44:25 +0000 (17:44 +0800)]
Report touch events on MS-Windows

* etc/NEWS: Announce change.

* src/w32fns.c (RegisterTouchWindow_fn): New function.
(w32_createwindow): Assign a base value for touch event
identifiers to the frame, and register for touch input.
(w32_wnd_proc): Forward WM_TOUCH/WM_TOUCHMOVE messages to the
main thread.
(globals_of_w32fns): Load RegisterTouchWindow from user32.dll.

* src/w32term.c (w32_read_socket) <WM_TOUCH>: Detect WM_TOUCH
events, compare and record their touch points with and into the
frame's record of their prior state, and report the same to Lisp.
(pfnCloseTouchInputHandle, pfnGetTouchInputInfo): New variables.
(w32_initialize): Load the above functions from user32.dll.

* src/w32term.h (MAX_TOUCH_POINTS): New definition.
(struct w32_output) <touch_ids, touch_x, touch_y, touch_base>:
New fields.

21 months ago; * doc/emacs/windows.texi (Tab Line, Window Tool Bar): Copyedits.
Eli Zaretskii [Sun, 9 Jun 2024 12:31:09 +0000 (15:31 +0300)]
; * doc/emacs/windows.texi (Tab Line, Window Tool Bar): Copyedits.

21 months agoAdd documentation for window-tool-bar package
Jared Finder [Sun, 9 Jun 2024 00:23:58 +0000 (17:23 -0700)]
Add documentation for window-tool-bar package

Also change window-tool-mode to not pay attention to if
tool-bar-map has a buffer local value or not as that made the
documentation complicated.  Documentation added in Emacs manual,
Elisp manual, package commentary, and docstrings.  Also extend
window-tool-bar support to Emacs 27 and newer.  (bug#68765)

* doc/emacs/emacs.texi (Top):
* doc/emacs/frames.texi (Menu Bars):
* doc/emacs/glossary.texi (Glossary):
* doc/emacs/modes.texi (Minor Modes):
* doc/emacs/windows.texi (Windows, Tab Line): Mention Window
Tool Bar.
(Window Tool Bar): New documentation.
* doc/lispref/elisp.texi (Top):
* doc/lispref/modes.texi (Mode Line Format, Mode Line Basics)
(Mode Line Data): Mention Tab Lines.
(Tab Lines): New documentation.
* etc/NEWS: Mention newly added variable and package.
* lisp/window-tool-bar.el (window-tool-bar-mode): Don't display
tool bar when tool-bar-map is nil.
* lisp/window-tool-bar.el (tool-bar-always-show-default): Define
variable for older Emacs versions.

21 months ago; Fix typo in help.texi
Stefan Kangas [Sun, 9 Jun 2024 11:00:33 +0000 (13:00 +0200)]
; Fix typo in help.texi

* doc/lispref/help.texi (Keys in Documentation): Fix typo.

21 months agoAdd new command 'package-vc-log-incoming'
Philip Kaludercic [Sun, 9 Jun 2024 10:39:47 +0000 (12:39 +0200)]
Add new command 'package-vc-log-incoming'

* lisp/emacs-lisp/package-vc.el (package-vc-log-incoming):
Implement it.
* etc/NEWS: Mention it.

21 months agoFix a recent change in reading from sub-processes
Eli Zaretskii [Sun, 9 Jun 2024 09:13:18 +0000 (12:13 +0300)]
Fix a recent change in reading from sub-processes

* src/process.c (make_process): Move to here...
(create_process): ...from here.

21 months agoFix Eshell tests on MS-Windows
Eli Zaretskii [Sun, 9 Jun 2024 07:56:39 +0000 (10:56 +0300)]
Fix Eshell tests on MS-Windows

* lisp/eshell/esh-util.el (eshell-get-path): Don't add "." if it
is already there.

* test/lisp/eshell/esh-var-tests.el
(esh-var-test/path-var/preserve-across-hosts): Skip on MS-Windows.
(esh-var-test/path-var/set, esh-var-test/path-var/set-locally):
Quote the PATH value, for MS-Windows.
* test/lisp/eshell/esh-util-tests.el (esh-util-test/path/get): No
need to add ".": it is already done by 'eshell-get-path'.
* test/lisp/eshell/esh-proc-tests.el
(esh-proc-test/kill-pipeline): Accept empty string as valid
output.
(esh-proc-test/sigpipe-exits-process): Skip on MS-Windows: no
SIGPIPE.
(esh-proc-test/emacs-command): Quote correctly for MS-Windows.
* test/lisp/eshell/em-unix-tests.el
(em-unix-test/compile/interactive): Fix test on MS-Windows.
* test/lisp/eshell/em-script-tests.el (em-script-test/batch-file):
Skip on MS-Windows.
* test/lisp/eshell/eshell-tests-helpers.el
(eshell-command-result--equal): Compare strings (file names)
case-insensitively on MS-Windows.

21 months ago(hack-dir-local-get-variables-functions): New hook
Stefan Monnier [Tue, 4 Jun 2024 15:00:32 +0000 (11:00 -0400)]
(hack-dir-local-get-variables-functions): New hook

Make it possible to provide more dir-local variables, such as
done by the Editorconfig package.

* lisp/files.el (hack-dir-local--get-variables): Make arg optional.
(hack-dir-local-get-variables-functions): New hook.
(hack-dir-local-variables): Run it instead of calling
`hack-dir-local--get-variables`.

* doc/lispref/variables.texi (Directory Local Variables):
Document the new hook.

21 months ago(find-auto-coding): Provide filename to `auto-coding-functions`
Stefan Monnier [Tue, 4 Jun 2024 14:58:29 +0000 (10:58 -0400)]
(find-auto-coding): Provide filename to `auto-coding-functions`

Allow `auto-coding-functions` to know the file name.
Motivated by the needs of Editorconfig support.

* lisp/international/mule.el (auto-coding-file-name): New var.
(find-auto-coding): Let-bind it for `auto-coding-functions`.
Document the expectation that the arg be an absolute file name.

* doc/lispref/nonascii.texi (Default Coding Systems):
Mention `auto-coding-file-name`.

* test/lisp/international/mule-util-resources/test.utf-16le: New file.
* test/lisp/international/mule-tests.el (mule-tests--dir): New var.
(mule-tests--auto-coding): New fun.
(mule-tests--auto-coding-functions): New test.

21 months agoAdd typescript-ts-mode indentation for multi-assignment decls
Noah Peart [Fri, 19 Apr 2024 08:46:50 +0000 (01:46 -0700)]
Add typescript-ts-mode indentation for multi-assignment decls

* lisp/progmodes/typescript-ts-mode.el
(typescript-ts-mode--indent-rules): Add indentation rules for
lexical and variable declarations with multiple assignments.
* test/lisp/progmodes/typescript-ts-mode-resources/indent.erts:
Add indent test for variable declarations (bug#68054).

21 months agoproject-list-buffers-ibuffer: Handle the FILES-ONLY argument
Dmitry Gutov [Sun, 9 Jun 2024 02:37:25 +0000 (05:37 +0300)]
project-list-buffers-ibuffer: Handle the FILES-ONLY argument

* lisp/progmodes/project.el (project-list-buffers-ibuffer):
Handle the FILES-ONLY argument (bug71290).
(project-list-buffers-buffer-menu): Expand docstring.

21 months agoSupport Ibuffer in project-list-buffers
mikpom [Sun, 9 Jun 2024 02:32:57 +0000 (05:32 +0300)]
Support Ibuffer in project-list-buffers

* lisp/progmodes/project.el (project-buffers-viewer): New option.
(project-list-buffers): Dispatch using it.
(project-list-buffers-buffer-menu, project-list-buffers-ibuffer):
New functions (bug#71290).

21 months ago; Fix coding style of last change
Po Lu [Sun, 9 Jun 2024 01:10:57 +0000 (09:10 +0800)]
; Fix coding style of last change

* src/process.c (read_and_insert_process_output)
(read_and_dispose_of_process_output): Fix coding style.

21 months agoread-process-output-max: Increase the default value
Dmitry Gutov [Sat, 8 Jun 2024 23:58:19 +0000 (02:58 +0300)]
read-process-output-max: Increase the default value

* src/process.c (read-process-output-max):
Increase the default value to 65536 (bug#66020).

21 months agoRemember the value of read_process_output_max when process is created
Dmitry Gutov [Sat, 8 Jun 2024 23:51:47 +0000 (02:51 +0300)]
Remember the value of read_process_output_max when process is created

* src/process.h (Lisp_Process): Add field readmax.

* src/process.c (read_process_output): Use it.
(create_process): Save the value of read_process_output_max to
it when the process is created (bug#66020).  Use for pipe size.

21 months agoGo around calling the default process filter (reducing GC churn)
Dmitry Gutov [Sat, 23 Sep 2023 22:19:14 +0000 (01:19 +0300)]
Go around calling the default process filter (reducing GC churn)

Instead of allocating strings and passing them to the filter, pass
the char buffer to a C function implementing the same logic.

* src/process.c (read_process_output_before_insert)
(read_process_output_after_insert):
New functions, extracted from internal-default-process-filter.
(Finternal_default_process_filter): Use them.
(read_and_insert_process_output): New function.  Use them.
(read_process_output_fast): New variable.
(read_process_output): Use it to choose how to insert (bug#66020).

* etc/NEWS: Mention the change.

21 months agourl-retrieve-synchronously: Fix timeout when connection hangs
Dmitry Gutov [Sat, 8 Jun 2024 21:52:26 +0000 (00:52 +0300)]
url-retrieve-synchronously: Fix timeout when connection hangs

* lisp/url/url.el (url-retrieve-synchronously):
Set url-asynchronous to t when TIMEOUT is non-nil (bug#71295).

21 months ago(pcase--app-subst-match): Try and fix performance regression (bug#71398)
Stefan Monnier [Sat, 8 Jun 2024 21:34:30 +0000 (17:34 -0400)]
(pcase--app-subst-match): Try and fix performance regression (bug#71398)

* lisp/emacs-lisp/pcase.el (pcase--app-subst-match): Optimize matches
against (quote VAL).
* test/lisp/emacs-lisp/pcase-tests.el (pcase-tests-quote-optimization):
Add new test case.

21 months agoImprove implementations of some Eshell output filter functions
Jim Porter [Tue, 4 Jun 2024 05:06:49 +0000 (22:06 -0700)]
Improve implementations of some Eshell output filter functions

* lisp/eshell/esh-mode.el (eshell-postoutput-scroll-to-bottom): Use
'get-buffer-window-list' for simplicity.
(eshell-handle-control-codes): Use 're-search-forward'; this way is much
faster.

* test/lisp/eshell/esh-mode-tests.el: New file.

21 months agoBe more efficient when buffering output in Eshell
Jim Porter [Tue, 4 Jun 2024 05:01:48 +0000 (22:01 -0700)]
Be more efficient when buffering output in Eshell

This makes the built-in 'eshell/cat' 5-10x faster on large files in my
(somewhat limited) tests.  In addition, this change periodically
redisplays when using the Eshell buffered output so that users can see
some progress.

* lisp/eshell/esh-io.el (eshell-print-queue-size, eshell-print-queue,
eshell-print-queue-count): Make obsolete in favor of...
(eshell-buffered-print-size, eshell--buffered-print-queue)
(eshell--buffered-print-current-size): ... these.
(eshell-buffered-print-redisplay-throttle): New user option.
(eshell--buffered-print-next-redisplay): New variable.
(eshell-init-print-buffer): Make obsolete.
(eshell-flush): Add new REDISPLAY-NOW argument in favor of CLEAR (which
only 'eshell-init-print-buffer' should have used).
(eshell-buffered-print): Compare queued output length to
'eshell--buffered-print-current-size'.
(eshell-with-buffered-print): New macro.

* lisp/eshell/esh-var.el (eshell/env):
* lisp/eshell/em-dirs.el (eshell/cd):
* lisp/eshell/em-hist.el (eshell/history):
* lisp/eshell/em-unix.el (eshell/cat):
* lisp/eshell/em-ls.el (eshell/ls): Use 'eshell-with-buffered-print'.
(flush-func): Remove.
(eshell-ls--insert-directory, eshell-do-ls): Remove 'flush-func'.

* test/lisp/eshell/em-unix-tests.el (em-unix-test/compile/interactive)
(em-unix-test/compile/pipeline, em-unix-test/compile/subcommand): Fix
indentation.
(em-unix-test/cat/file-output): New test.

* etc/NEWS: Announce these improvements.

21 months ago; Improve erc-format-privmessage documentation
F. Jason Park [Sat, 8 Jun 2024 00:08:08 +0000 (17:08 -0700)]
; Improve erc-format-privmessage documentation

* etc/ERC-NEWS: Mention that `erc-format-privmessage' has been removed
from the default client's primary code path.  Revise various headlines.
* lisp/erc/erc.el: Bump Compat version to 29.1.4.5.
(erc-format-privmessage): Make appeal for users to contact the mailing
list if they need to modify speaker-message formatting.

21 months agoRestore deferred date-stamp insertions in ERC
F. Jason Park [Wed, 5 Jun 2024 07:22:28 +0000 (00:22 -0700)]
Restore deferred date-stamp insertions in ERC

* lisp/erc/erc-stamp.el (erc-stamp--recover-on-reconnect): Treat
`erc-stamp--deferred-date-stamp' as a permanent-local variable.
(erc-stamp--date): Document expected possible values for `fn' slot.
(erc-stamp--defer-date-insertion-on-post-modify): Use the function
`ignore' to mean a new `erc-timer-hook' member has been requested.
Use nil to mean one has already run.  Deferred date stamps are new in
ERC 5.6 and Emacs 30.
(erc-stamp--date-mode): Improve doc string.
* test/lisp/erc/erc-scenarios-stamp.el
(erc-scenarios-stamp--date-mode/reconnect): New test.

21 months agoFix killing indirect buffers under auto-revert-mode
Eli Zaretskii [Sat, 8 Jun 2024 17:43:55 +0000 (20:43 +0300)]
Fix killing indirect buffers under auto-revert-mode

* lisp/autorevert.el (auto-revert-mode): Don't add indirect
buffers to 'auto-revert-buffer-list'.
(auto-revert-notify-rm-watch): Don't disable file notifications
when killing an indirect buffer.  (Bug#71424)

21 months ago; * doc/lispref/display.texi (Image Descriptors): Clarify text.
Eli Zaretskii [Sat, 8 Jun 2024 13:19:54 +0000 (16:19 +0300)]
; * doc/lispref/display.texi (Image Descriptors): Clarify text.

21 months agoFix 'string-edit' when abort-callback is omitted
Eli Zaretskii [Sat, 8 Jun 2024 13:07:24 +0000 (16:07 +0300)]
Fix 'string-edit' when abort-callback is omitted

* lisp/textmodes/string-edit.el (string-edit): Set
'string-edit--abort-callback' even if ABORT-CALLBACK is nil.
(Bug#71406)

21 months agoFix Python mode error caused by incorrect indentation
kobarity [Sat, 16 Sep 2023 14:14:45 +0000 (23:14 +0900)]
Fix Python mode error caused by incorrect indentation

* lisp/progmodes/python.el (python-indent--calculate-indentation):
Guard against negative indentation.  (Bug #65870)

* test/lisp/progmodes/python-tests.el
(python-indent-badly-indented-block-end): New test.

21 months agoCheck for doc-spec-function early, in interactive invocation
James Thomas [Sun, 2 Jun 2024 00:29:35 +0000 (05:59 +0530)]
Check for doc-spec-function early, in interactive invocation

* lisp/info-look.el (info-lookup-interactive-arguments):
Move here.
(info-lookup): From here.  (Bug#71314)

21 months agoMake 'clone-indirect-buffer-other-window' use other window
Richard Sent [Mon, 27 May 2024 15:32:00 +0000 (11:32 -0400)]
Make 'clone-indirect-buffer-other-window' use other window

Previously, depending on the settings in 'display-buffer-alist',
'clone-indirect-buffer-other-window' would display the cloned
buffer in the original window, behaving identically to
'clone-indirect-buffer' with a non-nil display-flag.  This
behavior was inconsistent with other-window commands which
always used another window.
Now, 'clone-indirect-buffer-other-window' uses
'switch-to-buffer-other-window'.  This means it uses the same
logic as other-window commands like 'find-file-other-window'
and 'info-other-window'.
display-flag was kept for API stability and functional
compatibility reasons.
* lisp/simple.el: (clone-indirect-buffer-other-window): Use
switch-to-buffer-other-window.  (Bug#70819)

21 months agoMerge from origin/emacs-29
Eli Zaretskii [Sat, 8 Jun 2024 11:34:20 +0000 (07:34 -0400)]
Merge from origin/emacs-29

53e9caa23ef ; * doc/emacs/help.texi (Help, Apropos): Improve text and...
00360258cad Fix treesit-parse-string crash (bug#71012)
20af58d3a13 Check for buffer liveness when accessing tree-sitter node...

21 months ago; * doc/emacs/help.texi (Help, Apropos): Improve text and indexing.
Eli Zaretskii [Sat, 8 Jun 2024 11:10:10 +0000 (14:10 +0300)]
; * doc/emacs/help.texi (Help, Apropos): Improve text and indexing.

21 months agoImprove scaling of tab bar items on high-density displays
Po Lu [Sat, 8 Jun 2024 07:17:23 +0000 (15:17 +0800)]
Improve scaling of tab bar items on high-density displays

* lisp/tab-bar.el (tab-bar-auto-width-max)
(tab-bar-auto-width-min): Accept values of a new format where
the pixel width is a list and is subject to scaling.
(tab-bar-auto-width-1): New function.
(tab-bar-auto-width): Scale pixel values from t-b-a-w-min and
t-b-a-w-max.

21 months agoRemove touchscreen pinch event generation threshold
Po Lu [Sat, 8 Jun 2024 06:25:22 +0000 (14:25 +0800)]
Remove touchscreen pinch event generation threshold

* lisp/touch-screen.el (touch-screen-handle-aux-point-update):
Remove the said threshold.

21 months ago; Fix typos
Stefan Kangas [Fri, 7 Jun 2024 21:42:42 +0000 (23:42 +0200)]
; Fix typos

21 months agoAvoid crashes in half-baked emacsclient frames
Eli Zaretskii [Fri, 7 Jun 2024 19:30:41 +0000 (22:30 +0300)]
Avoid crashes in half-baked emacsclient frames

If a client connection comes in while we handle a Lisp error,
the new frame creation could signal an error before the new
frame is ready for display.
* src/xdisp.c (redisplay_internal): Don't redisplay windows on
frames that were not completely set up.  (Bug#71224)

21 months ago* lisp/buff-menu.el (Buffer-menu-group-sort-by): New defcustom.
Juri Linkov [Fri, 7 Jun 2024 16:57:07 +0000 (19:57 +0300)]
* lisp/buff-menu.el (Buffer-menu-group-sort-by): New defcustom.

(list-buffers--refresh): Use Buffer-menu-group-sort-by instead of the
hard-coded function (bug#70150).
(Buffer-menu-group-sort-alphabetically): New function as an option for
'Buffer-menu-group-sort-by'.
(list-buffers-noselect): Remove setting outline-minor-mode-use-buttons
to 'in-margins' that it not required for this feature to work correctly.

* lisp/emacs-lisp/tabulated-list.el (tabulated-list-groups-sort):
Add optional argument 'level'.

21 months agoAdd new alist entry 'some-window' for 'display-buffer-use-some-window'
Juri Linkov [Fri, 7 Jun 2024 16:45:06 +0000 (19:45 +0300)]
Add new alist entry 'some-window' for 'display-buffer-use-some-window'

* doc/lispref/windows.texi (Buffer Display Action Functions):
Add details of using the alist entry 'some-window' in
'display-buffer-use-some-window'.
(Buffer Display Action Alists): Add 'some-window'.

* lisp/window.el (display-buffer-use-some-window):
Handle the alist entry 'some-window' (bug#70949).
Extend docstring with its description.

21 months ago* lisp/subr.el (with-silent-modifications): Minor simplification
Stefan Monnier [Fri, 7 Jun 2024 14:57:11 +0000 (10:57 -0400)]
* lisp/subr.el (with-silent-modifications): Minor simplification

21 months agoMerge remote-tracking branch 'savannah/master' into master-android-1
Po Lu [Fri, 7 Jun 2024 13:40:16 +0000 (21:40 +0800)]
Merge remote-tracking branch 'savannah/master' into master-android-1

21 months agoEliminate Makefile race
Po Lu [Fri, 7 Jun 2024 13:39:01 +0000 (21:39 +0800)]
Eliminate Makefile race

* java/Makefile.in (cf-stamp): Don't separately depend on
NDK_BUILD_SHARED, as this renders make liable to descend into
cross/ndk-build twice in different processes.
(clean): Don't remove nonexistent file.

21 months agoUnbreak the Cygw32 build
Eli Zaretskii [Fri, 7 Jun 2024 13:34:53 +0000 (16:34 +0300)]
Unbreak the Cygw32 build

It was broken by latest changes to w32image.c.
* src/emacs.c (main): Call 'syms_of_w32image' and
'globals_of_w32image' only if native image APIs are enabled.
(Bug#71412)

21 months ago; * java/INSTALL (LIBRSVG): Typo.
Po Lu [Fri, 7 Jun 2024 12:39:42 +0000 (20:39 +0800)]
; * java/INSTALL (LIBRSVG): Typo.

21 months agoDocument compilation of librsvg on Android
Po Lu [Fri, 7 Jun 2024 12:38:56 +0000 (20:38 +0800)]
Document compilation of librsvg on Android

* java/INSTALL (LIBRSVG): New section.
(BUILDING WITH OLD NDK VERSIONS): Update recommended invocation
of configure in the case of a combined toolchain.

21 months agoFix names of TeX-related major-modes
Arash Esbati [Wed, 5 Jun 2024 19:37:43 +0000 (21:37 +0200)]
Fix names of TeX-related major-modes

* lisp/ffap.el (ffap-alist, ffap-string-at-point-mode-alist): Add
entries for mode names introduced in AUCTeX v14.  Use
`plain-tex-mode' for built-in mode.  (bug#71376)

21 months agoFix tree-sitter markup in Elisp manual
Basil L. Contovounesios [Fri, 7 Jun 2024 09:05:19 +0000 (11:05 +0200)]
Fix tree-sitter markup in Elisp manual

* doc/lispref/parsing.texi (Retrieving Nodes, User-defined Things)
(Multiple Languages): Mark up variable names as @code, not
metasyntactic @var.

21 months agoFix user-error usage in sgml-mode.el
Basil L. Contovounesios [Fri, 7 Jun 2024 08:47:14 +0000 (10:47 +0200)]
Fix user-error usage in sgml-mode.el

* lisp/textmodes/sgml-mode.el (html-mode--image-yank-handler):
Address recent byte-compiler format string warnings (bug#71379).

21 months ago* lisp/buff-menu.el: Mark all entries in outline.
Juri Linkov [Fri, 7 Jun 2024 06:45:05 +0000 (09:45 +0300)]
* lisp/buff-menu.el: Mark all entries in outline.

(Buffer-menu-mark, Buffer-menu-unmark, Buffer-menu-delete)
(Buffer-menu-save): Mark all entries in the outline
when `outline-minor-mode' is enabled and point is
on the outline heading line (bug#70150).
(Buffer-menu-backup-unmark): Support outline heading lines.

21 months ago; * src/dispnew.c (update_frame_line): Fix thinko (bug#71289).
Eli Zaretskii [Fri, 7 Jun 2024 06:11:04 +0000 (09:11 +0300)]
; * src/dispnew.c (update_frame_line): Fix thinko (bug#71289).

21 months agoEglot: better fix for bug#70724
João Távora [Thu, 6 Jun 2024 22:08:28 +0000 (17:08 -0500)]
Eglot: better fix for bug#70724

If the project's root is or destroyed , this may happen for a
variety of reasons, including reasons affecting non-reconnection
scenarios, so better to check in eglot--connect.

An Eglot "reconnection" has always created as accurate a copy of
the previous server object as possible, down to the 'eq'ness or
the saved initargs, language ids, etc.  So re-querying for
projects is not the thing to do here.

A new different server can be created with `M-x eglot` which will
ask about shutting down the existing one.

* lisp/progmodes/eglot.el (eglot-reconnect):  Revert previous change.
(eglot--connect):  Do sanity check here

21 months agoeglot-reconnect: Re-fetch the current project
Dmitry Gutov [Thu, 6 Jun 2024 20:26:25 +0000 (23:26 +0300)]
eglot-reconnect: Re-fetch the current project

* lisp/progmodes/eglot.el (eglot-reconnect): Retrieve the current
project just in case something changed (bug#70724).

21 months agoPrevent another abort in 'cmcheckmagic'
Eli Zaretskii [Thu, 6 Jun 2024 14:43:00 +0000 (17:43 +0300)]
Prevent another abort in 'cmcheckmagic'

* src/dispnew.c (update_frame_line): Prevent rare aborts when TTY
frame is resized.  (Bug#71289)

21 months agoMinor enhancements to the Android build system
Po Lu [Thu, 6 Jun 2024 12:55:40 +0000 (20:55 +0800)]
Minor enhancements to the Android build system

* build-aux/ndk-build-helper-1.mk:

* build-aux/ndk-build-helper-2.mk:

* cross/ndk-build/ndk-build-shared-library.mk:

* cross/ndk-build/ndk-build-static-library.mk:

* cross/ndk-build/ndk-resolve.mk
(NDK_SO_EXTRA_FLAGS_$(LOCAL_MODULE)):
(NDK_LOCAL_SO_NAMES_$(LOCAL_MODULE)):
(NDK_LOCAL_A_NAMES_$(LOCAL_MODULE)): Reinforce tests for string
prefixes.

* m4/ndk-build.m4 (ndk_INIT): Guarantee that a module's
dependencies are recorded.

* configure.ac (XCONFIGURE): Prepare for building librsvg.

21 months agoEnable code block evaluation when generating .org manuals
Kyle Meyer [Wed, 29 May 2024 04:05:46 +0000 (00:05 -0400)]
Enable code block evaluation when generating .org manuals

* doc/misc/Makefile.in ($(1:.org=.texi)): Enable code
block evaluation in Org mode manual and other .org manuals
to produce automatically generated parts.  (Bug#71394)
When testing a scratch sync to the Emacs repo, the build
failed with

 make[3]: Leaving directory '/home/kyle/src/savannah/emacs--master/lisp'
 Evaluate this emacs-lisp code block on your system? (yes or no)
 Error: end-of-file ("Error reading from stdin")
   yes-or-no-p("Evaluate this emacs-lisp code block on your system? ")

That's expected given 715148131 (org-manual: Automatically
generate export option list, 2023-07-31) and the default
org-confirm-babel-evaluate value.

21 months ago; Fix last change in sqlite.c
Eli Zaretskii [Thu, 6 Jun 2024 10:06:58 +0000 (13:06 +0300)]
; Fix last change in sqlite.c

* etc/NEWS:
* doc/lispref/text.texi (Database):
* src/sqlite.c (Fsqlite_execute_batch): Fix last change (Bug#70145).

21 months agoMerge branch 'master' of git.savannah.gnu.org:/srv/git/emacs
Eli Zaretskii [Thu, 6 Jun 2024 10:06:51 +0000 (13:06 +0300)]
Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs

21 months agoAdd 'sqlite-execute-batch' command
Javier Olaechea [Mon, 1 Apr 2024 04:07:10 +0000 (23:07 -0500)]
Add 'sqlite-execute-batch' command

This command is similar to 'sqlite-execute' except that it
executes multiple statements in exchange for not accepting
any arguments.  (Bug#70145)
* src/sqlite.c (Fsqlite_execute_batch): New function.

* test/src/sqlite-tests.el (sqlite-multiple-statements): Add
smoke test for 'sqlite-execute-batch'.

* etc/NEWS: Mention new command 'sqlite-execute-batch'.
* doc/lispref/text.texi (Database): Document the new command.

22 months agoFormat string warnings for more functions (bug#71379)
Mattias Engdegård [Wed, 5 Jun 2024 16:28:59 +0000 (18:28 +0200)]
Format string warnings for more functions (bug#71379)

* lisp/emacs-lisp/bytecomp.el (byte-compile-format-like):
Add message-box, message-or-box, warn and user-error.

22 months agoAttempt to fix rare assertion violations in 'mark_terminals'
Eli Zaretskii [Thu, 6 Jun 2024 07:47:21 +0000 (10:47 +0300)]
Attempt to fix rare assertion violations in 'mark_terminals'

* src/terminal.c (delete_terminal): Block input while we modify
the frame list and 'terminal_list'.  (Bug#71289)

22 months ago* java/AndroidManifest.xml.in: Revert portions of last change.
Po Lu [Thu, 6 Jun 2024 01:15:50 +0000 (09:15 +0800)]
* java/AndroidManifest.xml.in: Revert portions of last change.

22 months agoSelect correct frame after enabling erc-nickbar-mode
F. Jason Park [Tue, 4 Jun 2024 17:42:35 +0000 (10:42 -0700)]
Select correct frame after enabling erc-nickbar-mode

* lisp/erc/erc-speedbar.el (erc-speedbar--ensure): Re-select frame
originally selected when earlier calling `speedbar-frame-mode'.  Do
this because `speedbar-frame' may become the new selected frame when
multiple visible frames exist.
(erc-nickbar-disable): Don't expect the mode to have been enabled
previously.

22 months agoDon't recurse in erc-server-delayed-check-reconnect
F. Jason Park [Tue, 28 May 2024 07:32:13 +0000 (00:32 -0700)]
Don't recurse in erc-server-delayed-check-reconnect

* lisp/erc/erc-backend.el (erc-server-delayed-check-reconnect): Run
`reschedule' function on a timer to avoid growing the stack when
calling `delete-process'.
* lisp/erc/erc-common.el (erc--favor-changed-reverted-modules-state):
Fix `pcase' condition so that changing an option to its standard value
does not earn a "STANDARD" label in Customize if that value differs
from the saved one.
* lisp/erc/erc.el (erc-open-socks-tls-stream): Reword doc string.
* test/lisp/erc/erc-tests.el (erc--with-dependent-type-match)
(erc--with-dependent-type-match): Remove useless tests (bug#71178).
* test/lisp/erc/resources/base/reconnect/unexpected-disconnect.eld:
Await phantom EOFs and PINGs to somewhat account for a race that can
result in a failure when running the suite in parallel with -jN.
* test/lisp/erc/resources/erc-scenarios-common.el
(erc-scenarios-common--print-trace): Set `debug-on-error' to t
so that errors in timers always trigger test failures.
;; * test/lisp/erc/resources/base/assoc/reconplay/foonet.eld:
;; Timeouts.
;; * test/lisp/erc/resources/base/upstream-reconnect/soju-barnet.eld:
;; Timeouts.
;; * test/lisp/erc/resources/base/mask-target-routing/foonet.eld:
;; Timeouts.
;; * test/lisp/erc/resources/join/network-id/barnet.eld: Timeout.

22 months agoAllow multi-level outlines in tabulated-list-groups used by list-buffers
Juri Linkov [Wed, 5 Jun 2024 17:07:28 +0000 (20:07 +0300)]
Allow multi-level outlines in tabulated-list-groups used by list-buffers

* lisp/emacs-lisp/tabulated-list.el (tabulated-list-groups)
(tabulated-list-groups-categorize, tabulated-list-groups-sort)
(tabulated-list-groups-flatten): New functions (bug#70150).

* lisp/buff-menu.el (Buffer-menu-group-by): Change type from a function
to a list of functions.
(list-buffers--refresh): Use the function 'tabulated-list-groups' where
:path-function uses a list of functions from 'Buffer-menu-group-by', and
:sort-function is hard-coded to sort groups by name.
(Buffer-menu-group-by-mode, Buffer-menu-group-by-root): Remove prefix "*".

22 months ago; Fix last change.
Eli Zaretskii [Wed, 5 Jun 2024 16:32:17 +0000 (19:32 +0300)]
; Fix last change.

22 months agoAnother attempt to prevent crashes when resizing TTY frames
Eli Zaretskii [Wed, 5 Jun 2024 16:18:49 +0000 (19:18 +0300)]
Another attempt to prevent crashes when resizing TTY frames

* src/dispnew.c (frame_size_change_delayed): Accept frame as
argument, and check the 'new_size_p' flag of the frame in
addition to 'delayed_size_change'.  Callers changed.
(window_to_frame_vpos, build_frame_matrix_from_leaf_window): Call
'frame_size_change_delayed' instead of looking at
delayed_size_change alone.  (Bug#71289)

22 months ago; * .gitignore: Add lib/endian.h (bug#71378).
Collin Funk [Wed, 5 Jun 2024 11:13:32 +0000 (04:13 -0700)]
; * .gitignore: Add lib/endian.h (bug#71378).

Copyright-paperwork-exempt: yes

22 months agoNew user option 'completion-preview-idle-delay'
Eshel Yaron [Wed, 5 Jun 2024 08:23:56 +0000 (10:23 +0200)]
New user option 'completion-preview-idle-delay'

Support displaying the completion preview shortly after you
pause typing (on idle) rather than immediately.

* lisp/completion-preview.el (Commentary): Update.
(completion-preview--try-update):
(completion-preview--update-from-timer): New functions.
(completion-preview--timer): New buffer-local variable.
(completion-preview-idle-delay): New user option.
(completion-preview--show): Use it.
(completion-preview--post-command):
(completion-preview-mode): Disable idle timer if active.

22 months agoAllow 'completion-preview-require-minimum-symbol-length' to be nil
Eshel Yaron [Wed, 5 Jun 2024 08:03:06 +0000 (10:03 +0200)]
Allow 'completion-preview-require-minimum-symbol-length' to be nil

With some completion backends, completion preview is useful not only
after a partial symbol, but also after punctuation and other non-symbol
characters.  For example, in C code it's helpful to display the
completion preview for struct members when point is after 'foo->'.
Provide an option to skip the check for minimum symbol length at point
in order to support this use case.

* lisp/completion-preview.el
(completion-preview-minimum-symbol-length): Mention possible nil
value in type and docstring.
(completion-preview-require-minimum-symbol-length): Skip check
if 'completion-preview-minimum-symbol-length' is nil.

22 months agoFix Mac OS build
Po Lu [Wed, 5 Jun 2024 09:11:27 +0000 (17:11 +0800)]
Fix Mac OS build

* src/nsfns.m (ns_make_frame_key_window): Restore, but
only when NS_IMPL_COCOA.

22 months agoFix the GNUstep build
Po Lu [Wed, 5 Jun 2024 08:41:52 +0000 (16:41 +0800)]
Fix the GNUstep build

* src/Makefile.in (NON_OBJC_CFLAGS): Add
-Wflex-array-member-not-at-end.

* src/lisp.h (flush_stack_call_func): "asm" is unavailable in
Objective C.

* src/nsfns.m (ns_make_frame_key_window): Delete unused
function.

22 months agoRehighlight hi-lock patterns after reverting the buffer.
Juri Linkov [Wed, 5 Jun 2024 06:38:39 +0000 (09:38 +0300)]
Rehighlight hi-lock patterns after reverting the buffer.

* lisp/hi-lock.el (hi-lock-revert-buffer-rehighlight): New function.
(hi-lock-mode): Add hi-lock-revert-buffer-rehighlight to
revert-buffer-restore-functions, and remove after mode is disabled.
https://lists.gnu.org/archive/html/emacs-devel/2024-06/msg00044.html

22 months agoUse revert-buffer-restore-functions in xref-revert-buffer (bug#49731)
Juri Linkov [Wed, 5 Jun 2024 06:35:50 +0000 (09:35 +0300)]
Use revert-buffer-restore-functions in xref-revert-buffer (bug#49731)

* lisp/progmodes/xref.el (xref-revert-buffer):
When 'revert-buffer-restore-functions' is bound,
use it in the same way as in 'revert-buffer'.

22 months agoReorder Calc units table
Ulrich Müller [Wed, 5 Jun 2024 06:19:56 +0000 (08:19 +0200)]
Reorder Calc units table

* lisp/calc/calc-units.el (math-standard-units): Reorder the
table, so that all CODATA values are grouped together.

22 months ago; * lisp/calc/calc-units.el: Update a comment.
Ulrich Müller [Wed, 5 Jun 2024 06:08:59 +0000 (08:08 +0200)]
; * lisp/calc/calc-units.el: Update a comment.

22 months agoSpelling fixes
Paul Eggert [Wed, 5 Jun 2024 05:13:47 +0000 (22:13 -0700)]
Spelling fixes

22 months agoAdd manual entry for treesit-primary-parser
Yuan Fu [Wed, 5 Jun 2024 04:32:19 +0000 (21:32 -0700)]
Add manual entry for treesit-primary-parser

* doc/lispref/parsing.texi (Multiple Languages): Add entry.
* etc/NEWS (Example): Add news.

22 months agoRevert "New function treesit-parser-changed-ranges"
Yuan Fu [Wed, 5 Jun 2024 02:55:33 +0000 (19:55 -0700)]
Revert "New function treesit-parser-changed-ranges"

This reverts commit 996b9576713f9d63ea7ff7e9630a15cb0a0214eb.

For reason see 760b54de080.

22 months agoMore-permanent fix for build with Android NDK r10b
Paul Eggert [Tue, 4 Jun 2024 18:54:24 +0000 (11:54 -0700)]
More-permanent fix for build with Android NDK r10b

* configure.ac (gl_cv_header_working_endian_h):
Remove temporary workaround for Android.
* lib/endian.in.h: Copy latest version from Gnulib.

22 months ago* lisp/outline.el (outline-revert-buffer-rehighlight): New function.
Juri Linkov [Tue, 4 Jun 2024 16:53:47 +0000 (19:53 +0300)]
* lisp/outline.el (outline-revert-buffer-rehighlight): New function.

(outline-minor-mode): Add 'outline-revert-buffer-rehighlight' to
'revert-buffer-restore-functions'.  When mode is disabled,
remove hooks from 'revert-buffer-restore-functions' and
also from 'after-change-functions'.